import request from '@/utils/request'

export function getPage(data) {
  return request({
    url: `/region/page?regionName=${data.regionName}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function getSchoolPage(data) {
  return request({
    url: `/school/page?schoolName=${data.schoolName}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function getBasePage(data) {
  return request({
    url: `/base/page?baseName=${data.baseName}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function addRegion(data) {
  return request({
    url: `/region/addRegion`,
    method: 'post',
    data: data // body
  })
}

export function updateRegion(data) {
  return request({
    url: `/region/updateRegion`,
    method: 'post',
    data: data
  })
}

export function deleteRegion(data) {
  return request({
    url: `/region/deleteRegion?regionId=${data.regionId}`,
    method: 'post'
  })
}

export function deleteRegions(data) {
  return request({
    url: `/region/deleteRegions?regionIds=${data.item}`,
    method: 'post'
  })
}
